#ifndef PEAKWIDGET_H
#define PEAKWIDGET_H

#include "peakbar.h"

class PeakWidget : public AGroupBox
{
    Q_OBJECT
public:
    explicit PeakWidget(const uint8_t &channel, const double &gainMax, const QStringList &items, const QString &title, QWidget *parent = nullptr);
    uint8_t channel() const;
signals:
    void speakerChanged(uint8_t, uint8_t);
    void gainChanged(uint8_t, uint16_t);
    void group(uint8_t, uint8_t);
public slots:
    void set(uint16_t gain, uint8_t speaker);
    void peak(const uint8_t &value);
private slots:
    void comboBoxChanged(const int &index);
    void sliderChanged(const int &value);
    void spinBoxChanged(const double &value);
    void speakerToggled(bool checked);
private:
    void setBlockSignals(bool block);
private:
    uint8_t m_channel;
    AComboBox *comboBox;
    PeakBar *bar;
    ASlider *slider;
    ADoubleSpinBox *spinBox;
    APushButton *speakerButton; 
};

#endif // PEAKWIDGET_H
